Skip to content

Fix Flickering issue#17

Open
omelsoft wants to merge 1 commit intoSidebarJS:masterfrom
omelsoft:patch-1
Open

Fix Flickering issue#17
omelsoft wants to merge 1 commit intoSidebarJS:masterfrom
omelsoft:patch-1

Conversation

@omelsoft
Copy link
Copy Markdown

Flickering Issue when moving up and down a scrollable document while the sidebar is open

See: SidebarJS/angular-sidebarjs#7

This is generated when updating the sidebarjs.scss file and compile the CSS.

Added the following in the --is-moving class:

[sidebarjs-container] {
transform: none!important;
}

in the following.

[sidebarjs] {
@extend %component--full-screen;
position: fixed;
z-index: 9999;
transition: transform 0s $timing $duration;
&.sidebarjs--is-visible {
@include component--is-visible;
}
&.sidebarjs--is-moving {
transition: none;
transform: translate(0, 0);
[sidebarjs-container] {
transform: none!important;
}

[sidebarjs-container],
[sidebarjs-backdrop] {
transition: none;
}
}
}
The issue is that every time the user moves up and down the transform property always gets updated. That's the reason for the flickering issue. To fix that, I added an override to force the transform to none.

Flickering Issue when moving up and down a scrollable document while the sidebar is open

See: SidebarJS/angular-sidebarjs#7


This is generated when updating the sidebarjs.scss file and compile the CSS.

Added the following in the --is-moving class:

[sidebarjs-container] {
            transform: none!important;
        }

in the following.

[sidebarjs] {
    @extend %component--full-screen;
    position: fixed;
    z-index: 9999;
    transition: transform 0s $timing $duration;
    &.sidebarjs--is-visible {
        @include component--is-visible;
    }
    &.sidebarjs--is-moving {
        transition: none;
        transform: translate(0, 0);
        **[sidebarjs-container] {
            transform: none!important;
        }**
        [sidebarjs-container],
        [sidebarjs-backdrop] {
            transition: none;
        }
    }
}
The issue is that every time the user moves up and down the transform property always gets updated. That's the reason for the flickering issue. To fix that, I added an override to force the transform to none.
@samoel02
Copy link
Copy Markdown

samoel02 commented Apr 23, 2022

Hi,I have tryied your css fix, it did fixed the moving sidebar but it looses the transition if you are done scrolling and tryied to open or close the sidebar.
the ideal solution is creating a small function to detect scrolling event and add a class like (.sidebarjs--is-scrolling).
This is a bug need to be fix in the core plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants